Skip to content

Commit d3651e4

Browse files
bttmlyklaudiosinani
authored andcommitted
Added ability to configure writable stream
1 parent 8d2b0a3 commit d3651e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

signale.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class Signale {
2222
this._scopeName = options.scope || '';
2323
this._timers = options.timers || new Map();
2424
this._types = Object.assign(types, this._customTypes);
25+
this._stream = options.stream || process.stdout;
2526

2627
Object.keys(this._types).forEach(type => {
2728
this[type] = this._logger.bind(this, type);
@@ -80,7 +81,7 @@ class Signale {
8081
}
8182

8283
_log(message) {
83-
process.stdout.write(message + '\n');
84+
this._stream.write(message + '\n');
8485
}
8586

8687
_formatDate() {

0 commit comments

Comments
 (0)